//
//  SettingCellViewModel.swift
//  App_Profile
//
//  Created by 蒋晨成 on 2022/2/7.
//

import App_Common_Views
import UICore
import UIKit

class SettingCellViewModel: ViewModel, SimpleCellViewModel {
    var identifier: String
    var size: CGSize

    var output: Output

    init(cellType: SettingCell.Type, data: Setting) {
        output = Output(url: data.url, target: data.url, title: data.title, detail: data.detail, icon: data.icon, showindicator: data.showIndicator, showSwitch: data.showSwitch, isOn: data.isOn)
        identifier = cellType.cellID
        size = cellType.estimatedItemSize(viewModel: nil)
        super.init()
    }
}

extension SettingCellViewModel {
    struct Output {
        let url: String?
        let target: String?
        let title: String
        let detail: String?
        let icon: UIImage?
        let showindicator: Bool
        let showSwitch: Bool
        let isOn: Bool
    }
}
